<template>
	<view class="mine-container">
		<image class="mine-bg" src="/static/Mine-bgphoto-1.png" mode="widthFix"></image>
		<view class="mine-avatar-box">
			<image class="mine-avatar" src="/static/avatar-default.png" mode="aspectFill"></image>
			<text class="mine-username">张三</text>
		</view>
		<view class="mine-main-box">
			<!-- 这里放"我的"页面的所有内容 -->
			<view class="mine-stats-row">
				<view class="mine-stats-right">
					<text class="mine-stats-label">您已来到晨夕相伴</text>
					<view class="mine-stats-days-row">
						<text class="mine-stats-days">001</text>
						<text class="mine-stats-days-unit">天</text>
					</view>
				</view>
				<view class="mine-stats-divider"></view>
				<view class="mine-stats-left">
					<view class="mine-stats-item">
						<text class="mine-stats-label">订单加急剩余次数</text>
						<text class="mine-stats-num">39</text>
					</view>
					<view class="mine-stats-item">
						<text class="mine-stats-label">委托订单</text>
						<text class="mine-stats-num">50h</text>
					</view>
				</view>
			</view>
			<view class="mine-list">
				<view class="mine-list-item" v-for="(item, idx) in listItems" :key="item.text" @click="handleListClick(idx)">
					<text class="mine-list-text">{{ item.text }}</text>
					<text class="mine-list-arrow">&gt;</text>
				</view>
			</view>
		</view>
		<!-- 底部自定义导航栏 -->
		<view class="bottom-nav">
			<view class="nav-item" :class="{ active: currentTab === 'home' }" @click="switchTab('home')">
				<image class="nav-icon" src="/static/Bottom_Home_1.png"></image>
				<text class="nav-text">首页</text>
			</view>
			<view class="nav-item" :class="{ active: currentTab === 'message' }" @click="switchTab('message')">
				<image class="nav-icon" src="/static/Bottom_Chat.png"></image>
				<text class="nav-text">消息</text>
			</view>
			<view class="nav-item" :class="{ active: currentTab === 'mine' }" @click="switchTab('mine')">
				<image class="nav-icon" src="/static/Bottom_Mine.png"></image>
				<text class="nav-text">我的</text>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	name: 'ElderlyMine',
	data() {
		return {
			currentTab: 'mine',
			listItems: [
				{ text: '全部订单' },
				{ text: '个人病史记录' },
				{ text: '用户协议' },
				{ text: '设置' },
			]
		}
	},
	onBackPress() {
		uni.reLaunch({ url: '/pages/index/index' });
		return true;
	},
	methods: {
		switchTab(tab) {
			if(tab === 'home') {
				uni.navigateTo({ url: '/pages/elderly/index' });
			} else if(tab === 'message') {
				uni.navigateTo({ url: '/pages/elderly/message' });
			} else if(tab === 'mine') {
				// 当前页无需跳转
			}
		},
		handleListClick(idx) {
			// 这里写跳转逻辑
		}
	}
}
</script>

<style>
.mine-container {
	width: 100%;
	min-height: 100vh;
	background: #f7f7f7;
	position: relative;
}
.mine-bg {
	width: 100%;
	display: block;
}
.mine-main-box {
	position: absolute;
	left: 0;
	right: 0;
	top: 500rpx;
	bottom: 100rpx;
	background: #fff;
	border-top-left-radius: 60rpx;
	border-top-right-radius: 60rpx;
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
	box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.08);
	padding: 48rpx 32rpx 0 32rpx;
	z-index: 2;
	overflow: auto;
}
.mine-title {
	font-size: 32rpx;
	color: #75af74;
	text-align: center;
	margin-bottom: 40rpx;
}
.bottom-nav {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: 100rpx;
	background: rgb(171, 210, 167);
	display: flex;
	border-top: 1rpx solid #e5e5e5;
	z-index: 999;
}
.nav-item {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 10rpx;
}
.nav-icon {
	width: 60rpx;
	height: 90rpx;
	margin-bottom: 8rpx;
}
.nav-text {
	font-size: 24rpx;
	color: #666666;
}
.nav-item.active .nav-text {
	color: #007aff;
}
.mine-stats-row {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 48rpx;
	height: 140rpx;
}
.mine-stats-left, .mine-stats-right {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	flex: 1;
	height: 100%;
}
.mine-stats-item {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	margin-bottom: 16rpx;
}
.mine-stats-label {
	font-size: 28rpx;
	color: #666;
	margin-bottom: 0;
	margin-right: 8rpx;
}
.mine-stats-num {
	font-size: 48rpx;
	color: #75af74;
	font-weight: bold;
	display: inline-block;
	white-space: nowrap;
	text-align: center;
}
.mine-stats-unit {
	font-size: 28rpx;
	color: #666;
	margin-left: 4rpx;
	display: inline-block;
	margin-left: 2rpx;
	white-space: nowrap;
}
.mine-stats-days-row {
	display: flex;
	flex-direction: row;
	align-items: baseline;
}
.mine-stats-days {
	font-size: 60rpx;
	color: #75af74;
	font-weight: bold;
	line-height: 1;
}
.mine-stats-days-unit {
	font-size: 28rpx;
	color: #666;
	margin-left: 8rpx;
}
.mine-stats-divider {
	width: 2rpx;
	height: 90rpx;
	background: #e5e5e5;
	margin: 0 32rpx;
	border-radius: 2rpx;
}
.mine-list {
	margin-top: 32rpx;
	background: #fff;
	border-radius: 0;
	overflow: hidden;
}
.mine-list-item {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	padding: 32rpx 24rpx;
	border-bottom: 1rpx solid #e5e5e5;
	border-radius: 0;
	background: #fff;
}
.mine-list-item:last-child {
	border-bottom: none;
}
.mine-list-text {
	font-size: 30rpx;
	color: #333;
}
.mine-list-arrow {
	font-size: 32rpx;
	color: #bbb;
	margin-left: 8rpx;
}
.mine-avatar-box {
	position: absolute;
	top: 120rpx;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	z-index: 3;
	width: 100%;
}
.mine-avatar {
	width: 140rpx;
	height: 140rpx;
	border-radius: 50%;
	border: 6rpx solid #fff;
	box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.08);
	background: #eee;
}
.mine-username {
	margin-top: 18rpx;
	font-size: 32rpx;
	color: #333;
	font-weight: 600;
	text-align: center;
	text-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
}
</style> 